
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "billing");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>
<style >
	#outStockInfoCopy{display:none}
	.thumbnail{margin: 0px}
	#logo{margin: 0px;padding: 0px;}
	#pic{padding: 0px;height:60px;width:60px;}
	td input{margin-top:-1px;margin-bottom:-1px;height:21px; width:98%;border:none;color:red}
	body{
		font-size:9px ;
		font-family:黑体,微软雅黑;
		overflow:hidden; 
	}
	.panel-body{
		overflow:auto;
	}
	.table{
		border:black 1px solid !important;
	}
	.table tr th{
		border:black 1px solid !important;
		text-align: center;
		padding:0px 2px !important;
	}
	.table tr td{	
		border:black 1px solid !important;
		padding:0px 2px !important;
		text-align: center;
	}
	textarea{
		line-height: 0.5 !important;
	}
</style>
<script type="text/javascript">
function saveData(){
	top.openModal("/billing/billing/print/electricalPrint?key="+$("#billingId").val()+"&comment="+$("#comment").val()+"&work="+$("#work").val()+"&address="+$("#address").val()+"&myUrl="+$("#myUrl").val(),"print_form","打印详情",1200,550);
}
	
</script>
<input type="hidden" id="billingId" name="billingId" value="${billing.billingId }"/>
<t:panel cssClass="panel-flat form-detailed border-top-primary border-top-xlg minHight" customBody="true" customHead="true">
	 <t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
		<t:button icon="icon-floppy-disk" onclick="saveData()" laddaType="progress" cssClass="btn-info" csize="sm">打印</t:button>
	</t:panelFoot>
	<div class="detailed-navbar-content panel-body">
		<div id="printContent" >
			<div class="text-center"><h3>${shop.shopName}销售单</h3></div>
				<table style="width:100%" border="0">
			   <tr>
			   	  <td >客户</td>
			   	  <td>${billing.customer.customerName}</td>
			      <td >开单日期</td>
			      <td><fmt:formatDate value="${billing.createDate}" type="date" dateStyle="default" pattern="yyyy-MM-dd"/></td>
			      <td >订单号</td>
			      <td >${billing.billingNo}</td>
			   </tr>
			   <tr>
			   	  <td >收货地址</td>
			      <td>${billing.address}</td>
				  <td >联系电话</td>	 
			   	  <td >${billing.customer.customerTel}</td> 
			   	  <td >欠款</td>	 
			      <td>${billing.unpaidAmount}</td>
			   </tr>	
			   <tr>
			   	  
			   	  
			   </tr>   	    
			</table>
			<table class="table " style="margin-top:10px;">
				<tr>
					<th style="width:50px">序号</th>
		           	<th style="width:100px">条形码</th>
		           	<th style="width:100px">商品名称</th>
		           	
		           	<th style="width:100px">规格1</th>
		           	<th style="width:100px">规格2</th>
		           	<th style="width:100px">单位</th>
		           	<th style="width:100px">数量</th>
		           	<th style="width:100px">单价</th>
		           	<th style="width:100px">小计</th>
				</tr>
				<c:set var="nullAll"  value="0"/>
				<c:set var="realPriceAll"  value="0"/>
				<c:set var="sequence"  value="0"/>
				<c:forEach var="outStockShow" items="${billing.outStock.outStockShows}">
					<c:forEach var="outStockCollocation" items="${outStockShow.outStockCollocations}" >
						<c:set var="nullAll"  value="${nullAll +outStockCollocation.collocationNum}"/>
						<c:set var="realPriceAll"  value="${realPriceAll +outStockCollocation.realPrice*outStockCollocation.collocationNum}"/>
						<tr id="outStockCollocation_${sequence}">
		
							<td>${sequence +1}</td>				
			            	<td>${outStockShow.cargo.shapeCode}</td>
			            	<td>${outStockShow.cargo.cargoName}</td>
			            	<td>${outStockCollocation.collocation.propertyNameOne}</td>
			            	<td>${outStockCollocation.collocation.propertyNameTwo}</td>
							<td>${outStockShow.cargo.unit}</td>
							<td>${outStockCollocation.collocationNum}</td>
							<td>${outStockCollocation.realPrice}</td>
							<td>${outStockCollocation.realPrice*outStockCollocation.collocationNum}</td>
						</tr>
						<c:set var="sequence"  value="${sequence +1}"/>
					</c:forEach>
				</c:forEach>
				<tr>
					<td colspan="2">合计:</td>
					<td colspan="4">${tfn:toChinaMoney(realPriceAll)}</td>
					<th >${nullAll}</th>
		           	<th ></th>
		           	<th >${realPriceAll}</th>
				</tr>
				</table>
				<table style="width:100%;margin-top:10px;" border="0">
				<tr>
					<td width="50px">备注:</td>
		           	<td colspan="8" >
		           		<textarea id="comment" name=""comment"" class="form-control" placeholder="请输入"></textarea>
					</td>
				</tr>
				<tr>
					<td>工行:</td>
		           	<td colspan="8" >
		           		<textarea id="work" name="work" class="form-control" placeholder="请输入"></textarea>
					</td>
				</tr>
				<tr>
					<td>地址:</td>
		           	<td colspan="8" >
		           		<textarea id="address" name="address" class="form-control" placeholder="请输入"></textarea>
					</td>
				</tr>
				<tr>
					<td>网址:</td>
		           	<td colspan="8" >
		           		<textarea id="myUrl" name="myUrl" class="form-control" placeholder="请输入"></textarea>
					</td>
				</tr>
			</table>
		</div>
	</div>

</t:panel>


<script type="text/javascript">
$(function(){
	tabpaneResize();

})

function tabpaneResize(){
	$(".panel-body").height($(window).height() - 70);
	
}
</script>

<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>

<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>